﻿@model ProjectunitViewModel
@{
    Layout = null;
    ViewBag.Title = "请假管理人员选择弹出框";
    int j = 0;
}
<div class="pageContent">
    <form method="post" id="from_unit" action="demo/common/ajaxDone.html" class="pageForm required-validate"
    onsubmit="return validateCallback(this,dialogAjaxDone)">
    <input type="hidden" id="flag" value="@(ViewBag.uids)" />
    <ul id="rygl_qjry_zTree" class="ztree">
    </ul>
    </form>
</div>
<div class="formBar">
    <ul>
        <li>
            <button type="button" class="close btn btn-default btn-sm">
                取xxxx消</button>
        </li>
    </ul>
</div>
<script type="text/javascript">

    var rygl_qjry_zTree;
    var setting = {
        treeObjId: "rygl_qjry_zTree",
        isSimpleData: true,              //数据是否采用简单 Array 格式，默认false
        treeNodeKey: "id",               //在isSimpleData格式下，当前节点id属性
        treeNodeParentKey: "pId",        //在isSimpleData格式下，当前节点的父节点id属性
        showLine: true,                  //是否显示节点间的连线
        checkable: false,                  //每个节点上是否显示 CheckBox
        callback: {
            nodeCreated: rygl_qjry_zTree_creat    //这是节点生成时的回调函数
        }
    };
    function rygl_qjry_zTree_creat(event, treeId, treeNode) {
        if (treeNode.pId != null) {
            $("#" + treeNode.tId + "_a").attr("rel", "rygl_qjry_list");
        }
    }
    $(function () {
        $.getJSON(
           "/PersonnelLog/ProjectSegment/GetSupervSJson?url=/PersonnelLog/PlmPersonLeave/PersonnelList",
           function (data) {
               rygl_qjry_zTree = $("#rygl_qjry_zTree").zTree(setting, data);
               rygl_qjry_zTree.expandAll(true);
               $("#rygl_qjry_zTree").initUI();
               $("#rygl_qjry_zTree>li:eq(0)>ul>li:eq(0)>a>button").click();
           });
    });
</script>
